fix(cli): stop dropping CI/agent telemetry, suppress HeyGen CI at workflow level#980
Merged
jrusso1020 merged 1 commit intoMay 20, 2026
Conversation
…kflow level The CI=true early-exit in shouldTrack() was hiding most modern usage (coding agents in Codespaces, CI pipelines, agent sandboxes). Remove it. Each event still carries is_ci/is_docker/is_tty from system.ts, so CI vs laptop traffic can be separated in PostHog without being dropped at ingestion. HeyGen's own CI is suppressed via HYPERFRAMES_NO_TELEMETRY=1 added to each workflow that exercises the CLI.
Collaborator
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
miguel-heygen
approved these changes
May 20, 2026
Collaborator
Author
Merge activity
|
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Two changes:
CI=trueearly-exit inshouldTrack()inpackages/cli/src/telemetry/client.ts. The previous block silently dropped every event from any environment that setCI=trueorCI=1— which is most of where modern usage now lives: coding agents in Codespaces, GitHub Actions, hosted dev sandboxes.HYPERFRAMES_NO_TELEMETRY=1to every HeyGen workflow that exercises the CLI (ci,regression,preview-regression,catalog-previews,player-perf,windows-render,docs). HeyGen-internal CI stays out of telemetry; external users' CI now flows in.Why
Investigating two recent traffic spikes on PostHog (Apr 23-30 and May 19) it became clear that most of the headless/agentic traffic we can see is from environments that don't set
CI=true(Codespaces, agent sandboxes). The traffic we can't see is from environments that do — i.e. proper CI pipelines. That's the wrong split: we want both populations measured, with the ability to slice between them.Every event still carries
is_ci(plusci_name,is_docker,is_tty) fromsystem.ts, so CI vs interactive can be separated in PostHog post-hoc instead of being filtered at ingest.How
CI=true/CI=1branch inshouldTrack(). The remaining gates are unchanged:HYPERFRAMES_NO_TELEMETRY=1,DO_NOT_TRACK=1, dev mode, missing PostHog key, user opt-out via the config file.env: HYPERFRAMES_NO_TELEMETRY: "1"at the top of each HeyGen workflow that runs the CLI directly or through producer tests. Skippedpublish.ymlandcodeql.yml(don't exercise the CLI).detectCI()andgetCIName()insystem.tscontinue to readCI,GITHUB_ACTIONS,GITLAB_CI, etc. to label events withis_ciandci_name. Unchanged.autoUpdate.tsandupdateCheck.tsstill skip onCI=true— that's about update prompts, unrelated to telemetry. Left alone.Test plan
bunx oxlint/bunx oxfmt --checkclean on changed filesbunx tsc --noEmitpasses inpackages/coreandpackages/studiobunx fallow auditcleancli_commandevents withis_ci=trueshould start appearing (previously near-zero). Events from*.github/workflows/*runs of this repo should NOT appear.Notes
HYPERFRAMES_NO_TELEMETRY=1(orDO_NOT_TRACK=1) themselves.showTelemetryNoticeinclient.ts) still gates onshouldTrack(), so CI environments will technically "show" the notice (to nobody) once per ephemeral machine. Standard OSS telemetry pattern.